.class public Lcom/brixd/niceapp/util/ToastUtils;
.super Ljava/lang/Object;
.source "ToastUtils.java"


# static fields
.field private static mToast:Landroid/widget/Toast;


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 7
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static show(I)V
    .registers 3
    .param p0, "resId"    # I

    .prologue
    .line 11
    invoke-static {}, Lcom/brixd/niceapp/service/AppService;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    invoke-static {v0, v1}, Lcom/brixd/niceapp/util/ToastUtils;->show(Ljava/lang/String;I)V

    .line 12
    return-void
.end method

.method public static show(II)V
    .registers 3
    .param p0, "resId"    # I
    .param p1, "duration"    # I

    .prologue
    .line 19
    invoke-static {}, Lcom/brixd/niceapp/service/AppService;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0, p1}, Lcom/brixd/niceapp/util/ToastUtils;->show(Ljava/lang/String;I)V

    .line 20
    return-void
.end method

.method public static show(III)V
    .registers 4
    .param p0, "resId"    # I
    .param p1, "duration"    # I
    .param p2, "gravity"    # I

    .prologue
    .line 23
    invoke-static {}, Lcom/brixd/niceapp/service/AppService;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-virtual {v0, p0}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0, p1, p2}, Lcom/brixd/niceapp/util/ToastUtils;->show(Ljava/lang/String;II)V

    .line 24
    return-void
.end method

.method public static show(Ljava/lang/String;)V
    .registers 2
    .param p0, "text"    # Ljava/lang/String;

    .prologue
    .line 15
    const/4 v0, 0x0

    invoke-static {p0, v0}, Lcom/brixd/niceapp/util/ToastUtils;->show(Ljava/lang/String;I)V

    .line 16
    return-void
.end method

.method public static show(Ljava/lang/String;I)V
    .registers 3
    .param p0, "text"    # Ljava/lang/String;
    .param p1, "duration"    # I

    .prologue
    .line 27
    const/4 v0, 0x0

    invoke-static {p0, p1, v0}, Lcom/brixd/niceapp/util/ToastUtils;->show(Ljava/lang/String;II)V

    .line 28
    return-void
.end method

.method public static show(Ljava/lang/String;II)V
    .registers 5
    .param p0, "text"    # Ljava/lang/String;
    .param p1, "duration"    # I
    .param p2, "gravity"    # I

    .prologue
    const/4 v1, 0x0

    .line 31
    sget-object v0, Lcom/brixd/niceapp/util/ToastUtils;->mToast:Landroid/widget/Toast;

    if-eqz v0, :cond_a

    .line 32
    sget-object v0, Lcom/brixd/niceapp/util/ToastUtils;->mToast:Landroid/widget/Toast;

    invoke-virtual {v0}, Landroid/widget/Toast;->cancel()V

    .line 35
    :cond_a
    invoke-static {}, Lcom/brixd/niceapp/service/AppService;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0, p0, p1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v0

    sput-object v0, Lcom/brixd/niceapp/util/ToastUtils;->mToast:Landroid/widget/Toast;

    .line 36
    if-lez p2, :cond_1b

    .line 37
    sget-object v0, Lcom/brixd/niceapp/util/ToastUtils;->mToast:Landroid/widget/Toast;

    invoke-virtual {v0, p2, v1, v1}, Landroid/widget/Toast;->setGravity(III)V

    .line 40
    :cond_1b
    sget-object v0, Lcom/brixd/niceapp/util/ToastUtils;->mToast:Landroid/widget/Toast;

    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    .line 41
    return-void
.end method
